﻿using Newtonsoft.Json;

namespace Marmat.Common.Http
{
    /// <summary>
    /// 返回结果的通用基类
    /// </summary>
    /// <typeparam name="T">Data对象的类型</typeparam>
    public class Result<T>
    {
        /// <summary>
        /// 执行状态(默认200,表示执行成功)
        /// </summary>
        [JsonProperty(PropertyName = "status")]
        public int Status { get; set; } = 200;

        /// <summary>
        /// 消息
        /// </summary>
        [JsonProperty(PropertyName = "msg")]
        public string Message { get; set; }

        /// <summary>
        /// 返回值
        /// </summary>
        [JsonProperty(PropertyName = "data")]
        public T Data { get; set; }
    }

    /// <summary>
    /// 返回值。
    /// </summary>
    public class Result : Result<object>
    {
    }
}
